<!DOCTYPE html>
<html style="width:100%;height:100%;">
<head>
 <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.9.0.min.js"></script>

    <title>Google Maps API Template</title> 
</head>
 
<body style="width:100%;height:100%;">
<div id="googleMap" style="width:100%;height:100%;"></div>
 
<script type="text/javascript">
// google.maps.MapTypeId.HYBRID      ：显示卫星图像的主要街道透明层
// google.maps.MapTypeId.ROADMAP      ：显示普通的街道地图
// google.maps.MapTypeId.SATELLITE    ：显示卫星图像
// google.maps.MapTypeId.TERRAIN      ：显示带有自然特征（如地形和植被）的地图  

function initialize(){
  var myCenter=new google.maps.LatLng(11.569593, 104.920915);
  var marker=new google.maps.Marker({
    position:myCenter,
    //animation:google.maps.Animation.BOUNCE
  }); 

  var mapProp = {
    center: myCenter,
    zoom:17,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    panControl:true,
    zoomControl:true,
    mapTypeControl:true,
    scaleControl:true,
    streetViewControl:true,
    overviewMapControl:true,
    rotateControl:true    
  };

  var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);
  marker.setMap(map); 

var infowindow = new google.maps.InfoWindow({
  content:"我们在这里!"
});
 
infowindow.open(map,marker);
  
}

function loadScript(){
  var script = document.createElement("script");
  script.type = "text/javascript";
  script.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyB6GHAYtKuxzrTKcbwi6VWg65TmOuI5608&sensor=true&callback=initialize";
  document.body.appendChild(script);
}
 



window.onload = loadScript;

$(document).ready(function(){

  $.post('https://www.googleapis.com/geolocation/v1/geolocate?key=AIzaSyB6GHAYtKuxzrTKcbwi6VWg65TmOuI5608',{

      "homeMobileCountryCode": 310,
      "homeMobileNetworkCode": 410,
      "radioType": "gsm",
      "carrier": "Vodafone",
      "considerIp": true,
      "cellTowers": [
        // See the Cell Tower Objects section below.
      ],
      "wifiAccessPoints": [
        // See the WiFi Access Point Objects section below.
      ]


  },function(res){
    //console.log(res.location);
  });
})
 

 
</script>

</body>
</html>